amends "../snippetTest.pkl"

examples {
  ["construct"] {
    1.ns
    2.us
    3.ms
    4.s
    5.min
    6.h
    7.d

    1.1.ns
    2.2.us
     3.3.ms
     4.4.s
     5.5.min
     6.6.h
     7.7.d
  }

  ["addition"] {
    2.s + 4.s
    2.2.s + 3.3.s
    2.s + 3.min
    10.ns + 7.d

    4.s + 2.s
    3.3.s + 2.2.s
    3.min + 2.s
    7.d + 10.ns
  }

  ["subtraction"] {
    2.s - 4.s
    2.2.s - 3.3.s
    2.s - 3.min
    10.ns - 7.d

    4.s - 2.s
    3.3.s - 2.2.s
    3.min - 2.s
    7.d - 10.ns
  }

  ["multiplication"] {
    2.s * 3
    2.s * 3.3
    2.2.s * 3
    2.2.s * 3.3

    3 * 2.s
    3.3 * 2.s
    3 * 2.2.s
    3.3 * 2.2.s
  }

  ["division"] {
    2.s / 3
    2.s / 3.3
    2.2.s / 3
    2.2.s / 3.3

    module.catch(() -> 3 / 2.s)
    module.catch(() -> 3.3 / 2.s)
    module.catch(() -> 3 / 2.2.s)
    module.catch(() -> 3.3 / 2.3.s)
  }

  ["division by duration"] {
    2.s / 3.s
    2.s / 3.3.s
    2.2.s / 3.min
    2.2.h / 3.3.s
  }

  ["negation"] {
    local d = -4.s
    d
    -d
    --d

    local d2 = -4.4.s
    d2
    -d2
    --d2
  }

  ["truncating division"] {
    5.s ~/ 3
    7.s ~/ 3.3
    6.2.s ~/ 3
    6.2.s ~/ 3.3
  }

  ["truncating division by duration"] {
    5.s ~/ 3.s
    7.s ~/ 3.3.s
    6.2.s ~/ 3.min
    6.2.h ~/ 3.3.s
  }

  ["power"] {
    2.s ** 3
    2.s ** 3.3
    2.2.s ** 3
    2.2.s ** 3.3
  }
}
